package Dbase;

import model.userData;

import java.sql.SQLException;
import java.sql.SQLOutput;
import java.util.ArrayList;
import java.util.Scanner;

public class test {
    public static void main(String[] args) throws SQLException, ClassNotFoundException {
        dataBase db = new dataBase();
        db.showConnected();
//        db.insert("GanYu","114514");
//        db.insert("Ying","2468");
//        db.insert("Kong","1357");
//        ArrayList<userData> userDatas = db.getAllUser();
//        System.out.println("总表共有,"+userDatas.size());
//        for(userData each : userDatas){
//            System.out.println(each.getId()+" "+each.getName()+" "+each.getPassword());
//        }

//        Scanner scanner = new Scanner(System.in);
//        int S_id = scanner.nextInt();
//        userData userData = db.getUser(S_id);
//        System.out.println(userData.getId()+" "+userData.getName());
//        db.close();

        userData userData = db.Login(10000,"114514");
//        System.out.println(userData);
        if(userData == null){
            System.out.println("用户不存在或密码错误");
        }
        else{
            System.out.println("欢迎登陆"+userData.getName());
        }
    }
}
